// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * RatingOption generated by hbm2java
 */
@Entity
@Table(name = "rating_option", catalog = "magento")
public class RatingOption implements java.io.Serializable {

	private Integer optionId;
	private Rating rating;
	private String code;
	private short value;
	private short position;
	private Set ratingOptionVotes = new HashSet(0);

	public RatingOption() {
	}

	public RatingOption(Rating rating, String code, short value, short position) {
		this.rating = rating;
		this.code = code;
		this.value = value;
		this.position = position;
	}

	public RatingOption(Rating rating, String code, short value,
			short position, Set ratingOptionVotes) {
		this.rating = rating;
		this.code = code;
		this.value = value;
		this.position = position;
		this.ratingOptionVotes = ratingOptionVotes;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "option_id", unique = true, nullable = false)
	public Integer getOptionId() {
		return this.optionId;
	}

	public void setOptionId(Integer optionId) {
		this.optionId = optionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "rating_id", nullable = false)
	public Rating getRating() {
		return this.rating;
	}

	public void setRating(Rating rating) {
		this.rating = rating;
	}

	@Column(name = "code", nullable = false, length = 32)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "value", nullable = false)
	public short getValue() {
		return this.value;
	}

	public void setValue(short value) {
		this.value = value;
	}

	@Column(name = "position", nullable = false)
	public short getPosition() {
		return this.position;
	}

	public void setPosition(short position) {
		this.position = position;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "ratingOption")
	public Set getRatingOptionVotes() {
		return this.ratingOptionVotes;
	}

	public void setRatingOptionVotes(Set ratingOptionVotes) {
		this.ratingOptionVotes = ratingOptionVotes;
	}

}
